<!doctype html>
<html class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title>后台登录</title>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" href="__PUBLIC__/css/xadmin.css">
<link rel="stylesheet" href="__PUBLIC__/css/font.css">
<link rel="stylesheet" href="__PUBLIC__/css/login.css">
<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
<script src="__PUBLIC__/lib/layui/layui.js" charset="utf-8"></script>
<!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<script>
	function fleshVerify() {
		//重载验证码 
		var time = new Date().getTime();
		document.getElementById('verifyImg').src = "{:url('verify')}";
	}
	$(document).ready(function() {
		layui.use([ 'form', 'layer', 'jquery' ], function() {
			var $ = layui.jquery, form = layui.form, layer = layui.layer;
			form.on('submit(login)', function(data) {
				data = data.field;
				if (data.account == '') {
					layer.msg('用户名不能为空');
					return false;
				} else if (data.password == '') {
					layer.msg('密码不能为空');
					return false;
				} else {
					$.ajax({
						dataType : "json",
						type : 'post',
						url : "{:url('checkLogin')}",
						data : $("form").serialize(),
						success : function(data) {
							layer.msg(data.msg);
							if (data.code == 99)
								window.location.href = data.url;
							else
								fleshVerify();
						}
					});
				}
			});
		});
	});
</script>
</head>
<body>
	<div class="main-body">
		<div class="login-main">
			<div class="login-top">
				<span>后台登录</span>
				<span class="bg1"></span>
				<span class="bg2"></span>
			</div>
			<form class="layui-form login-bottom">
				<div class="center">
					<div class="item">
						<span class="icon icon-2"></span>
						<input type="text" name="account" lay-verify="required" placeholder="请输入登录账号" maxlength="24" />
					</div>
					<div class="item">
						<span class="icon icon-3"></span>
						<input type="password" name="password" lay-verify="required" placeholder="请输入密码" maxlength="20">
						<span class="bind-password icon icon-4"></span>
					</div>
				</div>
				<div class="tip" style="display: none;">
					<span class="icon-nocheck"></span>
					<span class="login-tip">保持登录</span>
					<a href="javascript:" class="forget-password">忘记密码？</a>
				</div>
				<div class="layui-form-item" style="text-align: center; width: 100%; height: 100%; margin: 0px;">
					<button class="login-btn" lay-submit="" type="button" lay-filter="login">立即登录</button>
				</div>
			</form>
		</div>
	</div>
	<div class="footer hide">©版权所有 2019-2022  <span class="padding-5">|</span> <a target="_blank" href="http://www.miitbeian.gov.cn"></a></div>
</body>
</html>